<template>
  <div>
    <el-dialog title="查看详情" :visible.sync="dialogVisible" width="50%" @close="closeOpen">
      <div v-for="(e,i) in dataList" :key="i" class="flex-has">
        <div class="left">{{ e.label }}</div>
        <div class="right">{{ e.value }}</div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="success" @click="dialogVisible = false">返回</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataList: [],
      dialogVisible: false
    }
  },
  methods: {
    init(val) {
      this.dialogVisible = true
      for (const key in val) {
        const obj = {
          label: key,
          value: val[key]
        }
        this.dataList.push(obj)
      }

      console.log(this.dataList, 789)

      // console.log(val.split(','),789);

      // this.dataList.push()
    },
    closeOpen() {
      this.dialogVisible = false
      this.dataList = []
    }
  }

}
</script>
<style lang='less' scoped>

</style>
